package com.qf.service.impl;

import com.qf.dao.AccountDao;
import com.qf.service.AccountService;
import javafx.application.Application;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description: 公用常量
 * @Data: 2022/8/28 11:23
 * @Pacakge: com.qf.service.impl
 * @ClassName: AccountServiceImpl
 * @Author: fan
 */
public class AccountServiceImpl implements AccountService {
    public AccountServiceImpl(){
        System.out.println("AccountService的无参构造");
    }
    /**
     * 模拟添加账户
     */
    @Override
    public void addAccount() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("springconfig.xml");
        AccountDao accountDao =(AccountDao) applicationContext.getBean("accountDao");
        System.out.println("accountDao="+accountDao);
        accountDao.addAccount();
    }
}
